package com.zhangyusheng.easyecharts.component;

import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;

@Data
@Accessors(chain = true)
public class AreaStyle implements Serializable {
    private final static long serialVersionUID = 2L;

    private double opacity;
    /**
     * 渐变色
     *
     * @author Michael zhang
     * @email zhangys_0217@sina.com
     * @since 2025年11月03日
     */
    private LinearGradient color;
    private Emphasis emphasis;

    public static class Builder {
        private double opacity;
        /**
         * 渐变色
         */
        private LinearGradient color;
        private Emphasis emphasis;

        public Builder opacity(final double opacity) {
            this.opacity = opacity;
            return this;
        }

        public Builder color(final LinearGradient color) {
            this.color = color;
            return this;
        }

        public Builder emphasis(final Emphasis emphasis) {
            this.emphasis = emphasis;
            return this;
        }


        public AreaStyle build() {
            return new AreaStyle(this);
        }
    }

    private AreaStyle(final Builder builder) {
        opacity = builder.opacity;
        color = builder.color;
        emphasis = builder.emphasis;

    }
}
